<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<html>
       <f:view>
          <head>
             <title>
                Edit user account
             </title>
          </head>

          <body>
<h:form id="editUserAccountForm">
             <hr />
<h:panelGrid columns="6">
				<h:panelGroup>
				<h:outputText value="#{manageAccountController.user.emailAddress}" />
				</h:panelGroup>
				<h:outputText value="&nbsp;&nbsp;-&nbsp;&nbsp;" escape="false" />
				<h:commandLink action="#{homeController.home}">
		   			<f:param value="#{manageAccountController.user.id}" name="userId" />
					<h:outputText value="Home" />
				</h:commandLink>
				<h:commandLink action="#{myEventsController.listMyEvents}">
					<f:param value="#{manageAccountController.user.id}" name="userId" />
					<h:outputText value="My Events" />
				</h:commandLink>
				<h:commandLink action="#{manageAccountController.manageAccount}">
					<f:param value="#{manageAccountController.user.id}" name="userId" />
					<h:outputText value="My Account" />
				</h:commandLink>
						<h:commandLink action="#{loginController.logout}">
					<h:outputText value="Log Out" />
				</h:commandLink>
</h:panelGrid>
			<hr />
            
               <h2><h:outputText value="Edit Account"/></h2>
               <h:outputText value="<br/><br/>" escape="false"/>
                <h:outputText id="summary"/>
                <h:message for="summary" style="color: Red" />
<h:panelGrid columns="2">         
                 <h:outputText value="First name: "/>
                   <h:panelGroup>
                      <h:inputText id="firstName" 
                                   value="#{manageAccountController.user.firstName}"/>
                      <h:message for="firstName" style="color: Red"/>
                   </h:panelGroup>
                   
                   <h:outputText value=" Last name: "></h:outputText>
                   <h:panelGroup>
                      <h:inputText id="lastName" 
                                   value="#{manageAccountController.user.lastName}"/>
                      <h:message for="lastName" style="color: Red"/>
                   </h:panelGroup>
                   
                   
                   <h:outputText value="Your current email address : "/>
                   <h:panelGroup>
                      <h:outputText id="emailAddress" 
                         		   value="#{manageAccountController.user.emailAddress}" />
                    </h:panelGroup>
                   
                   <h:outputText value=" *Phone number: ">
                   </h:outputText>
                   
                   <h:panelGroup>
                      <h:inputText  id="contactPhoneNumber" 
                                    value="#{manageAccountController.user.contactPhoneNumber}">
                           <f:validateLength maximum="10"/> 
                      </h:inputText>
					<h:message for="contactPhoneNumber" style="color: Red"/>
                   </h:panelGroup>
</h:panelGrid>
                 <p>* Enter phone number without '-' or space. Please include area code.</p>
                 
	                 <h:outputText value="<br/>" escape="false"/>
	                 <h:panelGrid columns="2" cellspacing="15">
	                 <h:commandButton value="Save" action="#{manageAccountController.updateAccount}"/>
	            
	                 <h:commandButton value="Cancel" action="#{manageAccountController.cancel}" immediate="true"/>
	            </h:panelGrid>
             </h:form>
          </body>
       </f:view>
    </html>